package com.xpgk.mvc.budgetYear;

import java.util.List;

import com.jfinal.log.Log;
import com.xpgk.annotation.Table;
import com.xpgk.mvc.base.BaseModel;


/**
 * 预算记录详情表
 */
@SuppressWarnings("unused")
@Table(tableName = BudgetDetail.table_name)
public class BudgetDetail  extends  BaseModel<BudgetDetail>{
	

	/**
	 * 
	 */
	private static final long serialVersionUID = 5822647100568068666L;

	private static final Log log = Log.getLog(BudgetDetail.class);

	public static final BudgetDetail dao = new BudgetDetail().dao();

	/**
	 * 字段描述：该条数据添加人员is  字段类型：character varying 长度：32
	 */
	public static final String column_createId = "createId";
	/**
	 * 字段描述：该条数据添加时间  字段类型：datetime 长度：0
	 */
	public static final String column_createDate = "createDate";
	/**
	 * 字段描述：该条数据更新人员id  字段类型：character varying 长度：100
	 */
	public static final String column_updateId = "updateId";
	/**
	 * 字段描述：该条数据更新时间  字段类型：datetime 长度：0
	 */
	public static final String column_updateDate = "updateDate";
	/**
	 * 表名称
	 */
	public static final String table_name = "sb_shop_year_budget_detail";

	/**
	 * 字段描述：主键 字段类型：character varying 长度：32
	 */
	public static final String column_ids = "ids";
	/**
	 * 字段描述：预算ids 字段类型：character varying 长度：32
	 */
	public static final String column_budgetIds = "budgetIds";
	/**
	 * 字段描述：产品ids 字段类型：character varying 长度：32
	 */
	public static final String column_productIds = "productIds";
	/**
	 * 字段描述：年总预算数量 字段类型：character varying 长度：32
	 */
	public static final String column_yearSum = "yearSum";
	/**
	 * 字段描述：月均数量 字段类型：character varying 长度：32
	 */
	public static final String column_monthNum = "monthNum";
	/**
	 * 字段描述：一月数量 字段类型：character varying 长度：32
	 */
	public static final String column_januaryNum = "januaryNum";
	/**
	 * 字段描述：2月数量字段类型：character varying 长度：32
	 */
	public static final String column_februaryNum = "februaryNum";
	/**
	 * 字段描述：3月数量 字段类型：character varying 长度：32
	 */
	public static final String column_marchNum = "marchNum";
	
	/**
	 * 字段描述：4月数量 字段类型：character varying 长度：32
	 */
	public static final String column_aprilNum = "aprilNum";
	/**
	 * 字段描述：5月数量字段类型：character varying 长度：32
	 */
	public static final String column_mayNum = "mayNum";
	/**
	 * 字段描述：6月数量 字段类型：character varying 长度：32
	 */
	public static final String column_juneNum = "juneNum";
	/**
	 * 字段描述：7月数量 字段类型：character varying 长度：32
	 */
	public static final String column_julyNum = "julyNum";
	
	/**
	 * 字段描述：8月数量 字段类型：character varying 长度：32
	 */
	public static final String column_augustNum = "augustNum";
	/**
	 * 字段描述：9月数量 字段类型：character varying 长度：32
	 */
	public static final String column_septemberNum = "septemberNum";
	/**
	 * 字段描述：10月数量 字段类型：character varying 长度：32
	 */
	public static final String column_octoberNum = "octoberNum";
	/**
	 * 字段描述：11月数量 字段类型：character varying 长度：32
	 */
	public static final String column_novemberNum = "novemberNum";
	/**
	 * 字段描述：12月数量 字段类型：character varying 长度：32
	 */
	public static final String column_decemberNum = "decemberNum";
	/**
	 * 字段描述：更新时间 字段类型：date
	 */
	public static final String column_gxsj = "gxsj";
	
	
	
	public  BudgetDetail  getBudgetDetail(String budgetIds,String productIds)
	{
		String  sql="SELECT  *  from  sb_budget_detail  WHERE  budgetIds=?  and  productIds=? ";
		return  BudgetDetail.dao.findFirst(sql,budgetIds,productIds);
	}
	
	/**通过budgetIds获取年度预算详情
	 * 
	 * @param budgetIds
	 * @return
	 */
	public List<BudgetDetail>  getBudgetDetailList(String budgetIds)
	{
		String  sql="SELECT  *,productIds  proids,sys_getProductByColumn(productIds,'name') proname  FROM  sb_budget_detail  WHERE  budgetIds=?";
		return  BudgetDetail.dao.find(sql,budgetIds);
	}
}
